/*
 * @Author: lixiang
 * @Date: 2020-08-12 15:06:02
 * @Description: 路由跳转
 */
import router from "@/router";

/**
 * @description: 路由跳转
 * @param {type} 1param  2query
 */
function goTo(type = "2", _pageName, _params, _query) {
  switch (type) {
    case "1":
      router.push({
        name: _pageName,
        params: _params
      });
      break;
    case "2":
      router.push({
        path: `/${_pageName}`,
        query: _params
      });
      break;
    case "3":
      router.go(-1);
      break;
  }
}

export default {
  goTo
};
